

class Astar:
    
    def __init__( self, l_map, t_depart, t_arrivee, l_point_impossible ):
        self.__l_map              = l_map
        self.__t_depart           = t_depart
        self.__t_arrivee          = t_arrivee
        self.__l_point_impossible = l_point_impossible        
        
    def __initialise( self ):
        self.__parent = None
        self.__l_open, self.__l_close = list( ), list( )
        
    def getChemin( self ): 
        self.__initialise( )        
        point_courant = self.__t_depart 
        noeud_depart = { "G":0, "H":0, "F":0, "Point":point_courant, "Parent":point_courant }
        
        self.__l_close.append( noeud_depart )
        self.__addVoisin( point_courant )
        
        while( len( self.__l_open ) != 0  and point_courant != self.__t_arrivee ):
            point_courant = self.__getMeilleurNoeud( )
            for noeud in self.__l_open:
                if noeud["Point"] == point_courant:                    
                    self.__l_close.append( noeud )
                    break
            del self.__l_open[self.__l_open.index( noeud )]
            self.__addVoisin( point_courant )
        
        if( point_courant != self.__t_arrivee ):
            self.__retrouverChemin()
        else:
            #exception pas de chemin
            pass        
        
    def __getCout( self, t_depart, t_arrivee ):
        return ( ( t_arrivee[0] - t_depart[0] ) * ( t_arrivee[0] - t_depart[0] ) ) + ( ( t_arrivee[1] - t_depart[1] ) * ( t_arrivee[1] - t_depart[1] ) )
    
    def __addVoisins( self, noeud ):
        pass
            
    def __getMeilleurNoeud( self ):
        return None       
    
    def __retrouverChemin( self ):
        return None
    

    
    
if __name__ == "__main__":

    pass